#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
flask 路由注册
Attributes:
    __version__ (str): "0.0.1"
    __copyright__ (str): "Copyright (C) 2025 z"
    __license__ (str): "MIT"
    __author__ (str): "Z"
"""

# from __future__ import print_function, unicode_literals, absolute_import, division

# def register_app_routers(app, routers):
#     """注册路由函数"""
#     for url, func in routers.items():
#         app.add_url_rule(url, None, func, methods=['POST', 'GET'])


def register_app_routers(app, routers):
    """注册路由函数"""
    for url, func in routers.items():
        # 指定唯一的端点名称
        app.add_url_rule(url, endpoint=url.replace('/', '_'), view_func=func, methods=['POST', 'GET'])